<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>注册</title>
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../css/app.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"><span>返回</span></a>
			<h1 class="mui-title" id="title">注册</h1>
		</header>
		<div class="mui-content">
			<form class="mui-input-group">
				<div class="mui-input-row" style="margin-top: 35px">
					<input id='account' type="text" class="mui-input-clear mui-input" placeholder="请输入用户名">
				</div>
				<div class="mui-input-row">
					<input id='password' type="password" class="mui-input-clear mui-input" placeholder="请输入密码(请填写6~16位密码)">
				</div>
				<div class="mui-input-row">
					<input id='password2' type="password" class="mui-input-clear mui-input" placeholder="请确认密码">
				</div>				
			</form>
			<div class="mui-content-padded">
				<button id='reg' class="mui-btn main-btn-block">注册</button>
			</div>
			<div class="mui-text-center">
				<p>点击注册，即代表您同意<a>《用户协议》</a></p>
			</div>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/app.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8">
			mui.init();
			mui.plusReady(function () {
				var current = plus.webview.currentWebview();
				var srcwb=current.srcwb;
				document.getElementById("reg").addEventListener('tap',function () {
					var telephone=document.getElementById("account").value;
					var psw=document.getElementById("password").value;
					var psw2=document.getElementById("password2").value;
					if(!telephone|!psw|!psw2){
						plus.nativeUI.toast('请填写用户名和密码');
						return;
					}
					if(psw!==psw2){
						plus.nativeUI.toast('两次密码不一致');
						return;
					}
				});
				
				document.getElementById("reg").addEventListener('tap',function () {					
					user.setpwd(tel,psw,'Reg',function () {
						// 通知来源页刷新信息(可能是个人中心、订单中心等), reload中需要自己显示
						mui.fire(plus.webview.getWebviewById(srcwb),'reload',{show:true});
					});
				});
				showPage(current);
			});
		</script>
	</body>

</html>